home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Updates / HD-Installer / jst_dev / InstallWizard / ConfigInstall next >
Text File  |  2000-04-12  |  2KB  |  87 lines

  1. ; functions
  2.  
  3. ; setenv:
  4. ; #savemode: =0 writes to ENVARC: too
  5. ; #varname: name of the variable to affect
  6. ; #varvalue: required value
  7.  
  8. (procedure p_setenv #varname #varvalue
  9.    (run ("setenv %s \"%s\"" #varname #varvalue))
  10. )
  11.  
  12. ; get environment variables
  13.  
  14. (set #authorname (getenv "INSW/AUTHORNAME"))
  15. (set #authoremail (getenv "INSW/AUTHOREMAIL"))
  16. (set #editor (getenv "INSW/EDITOR"))
  17. (set #installroot (getenv "INSW/INSTALLROOT"))
  18. (set #loaderdevroot (getenv "INSW/LOADERDEVROOT"))
  19.  
  20. ; user prompts
  21.  
  22. (set #authorname
  23.     (askstring (prompt "What's your name ?")
  24.     (help 
  25.     "This name string will be used to author your installs/readmes\n"
  26.     "The general format is <firstname(s)> <name> (e.g: William H. Gates)")
  27.     (default #authorname)
  28.     )
  29. )
  30.  
  31. (set #authoremail
  32.     (askstring (prompt "What's your email address ?")
  33.     (help "This e-mail string will be used to author your readmes")
  34.     (default #authoremail)
  35.     )
  36. )
  37.  
  38. (set #editor
  39.     (askstring (prompt "What's your editor command/path ?")
  40.     (help "This editor will be used to edit readme and\n"
  41.       " to set default tool on developper text files")
  42.     (default #editor)
  43.     )
  44. )
  45.  
  46. (set #installroot
  47.     (askdir (prompt "Where should the user install files be generated ?")
  48.     (help "This dir will be used as a parent for your user install dirs")
  49.     (default #installroot)
  50.     )
  51. )
  52.  
  53. (set #loaderdevroot
  54.     (askdir (prompt "Where should the developper install files be generated ?")
  55.     (help "This dir will be used as a parent for your developper install dirs")
  56.     (default #loaderdevroot)
  57.     )
  58. )
  59.  
  60. (message ("\nYou selected the following:\n\nUser name: %s\nUser e-mail: %s\n\nUser install root: %s\nDevelopper install root: %s\n\nEditor to use: %s"
  61.            #authorname #authoremail #installroot #loaderdevroot #editor)
  62. )
  63.  
  64. (set #savemode
  65.      (askbool (prompt "Do you want to set the environment variables\n"
  66.                       "or to set them and save them (ENVARC:)?"
  67.                )
  68.               (help "Select \"Abort install\" to cancel everything")
  69.               (choices "Set only" "Set and save")
  70.       )
  71. )
  72.  
  73. (p_setenv "INSW/AUTHORNAME" #authorname)
  74. (p_setenv "INSW/AUTHOREMAIL" #authoremail)
  75. (p_setenv "INSW/EDITOR" #editor)
  76. (p_setenv "INSW/INSTALLROOT" #installroot)
  77. (p_setenv "INSW/LOADERDEVROOT" #loaderdevroot)
  78.  
  79. (if (= 0 #savemode) 
  80.   (
  81.    (makedir "ENVARC:INSW")
  82.    (copyfiles (help @copyfiles-help)
  83.        (source "ENV:INSW") (dest "ENVARC:INSW") (all)
  84.    )
  85.   )
  86. )
  87.